package org.example.design.bridge.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigDecimal;

/**
 * @Classname PayController
 * @Description
 * @Date 2020/11/3 2:34 下午
 * @Created by xiangjd
 */
public class PayController {

    private Logger logger = LoggerFactory.getLogger(PayController.class);

    public boolean doPay(String uid, String tradeId, BigDecimal amount, int channelType, int modelType) {
        if (1 == channelType) {
            logger.info("模拟微信划账开始，用户:{},交易id:{},金额:{}", uid, tradeId, amount);
            if (1 == modelType) {
                logger.info("密码支付，微信风控密码校验正常");
            } else if (2 == modelType) {
                logger.info("指纹支付，微信风控指纹校验正常");
            } else if (3 == modelType) {
                logger.info("人脸支付，微信风控人脸校验正常");
            }
        }

        if (2 == channelType) {
            logger.info("模拟支付宝划账开始，用户:{},交易id:{},金额:{}", uid, tradeId, amount);
            if (1 == modelType) {
                logger.info("密码支付，支付宝风控密码校验正常");
            } else if (2 == modelType) {
                logger.info("指纹支付，支付宝风控指纹校验正常");
            } else if (3 == modelType) {
                logger.info("人脸支付，支付宝风控人脸校验正常");
            }
        }
        return true;
    }
}

